package com.apes.framework.plugin.fsm;


import com.apes.framework.jpa.repository.CustomRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

public interface FsmStateRepository extends CustomRepository<FsmState, String> {

    List<FsmState> findAllByFsmFlowOrderByParentDesc(FsmFlow fsmFlow);
    List<FsmState> findAllByParent(FsmState parent);

    @Query(value = "select * from(select remark from yyesb.ir_logger where business_type = :businessType and business_key = :businessKey " +
            "and oa_flag = 1 and operate like %:operate% order by create_date desc) where rownum = 1",nativeQuery = true)
    String findRemark(@Param("businessType") String businessType , @Param("businessKey") String businessKey,@Param("operate") String operate);
}
